package com.community.controller.page;

import com.community.entity.Result;
import com.community.service.page.PageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/announcement")
public class PageController {

    @Autowired
    private PageService pageService;

    @GetMapping
    public Result getTop3Announcements() {
        return pageService.getTop3Announcements();
    }

    @GetMapping("/{id}")
    public Result getAnnouncementById(@PathVariable String id) {
        return pageService.getAnnouncementById(id);
    }
}